<template>
  <div class="mv">
    <video :src="url" controls="controls">Video元素</video>
  </div>
</template>

<script>
export default {
  data() {
    return {
      id: "", //视频id
      url: "",
    };
  },
  computed: {},
  watch: {},

  methods: {
    //获取视频播放的地址信息
    async getVideo() {
      const res = await this.$http.get(
        `http://localhost:3000/video/url?id=89ADDE33C0AAE8EC14B99F6750DB954D`
      );
      this.url = res.data.urls[0].url;
      console.log("视频url", this.url);
    },
  },
  created() {
    console.log(this.$route.params.id);
    this.id = this.$route.params.id;
    this.getVideo();
  },
  mounted() {},
  components: {},
};
</script>
<style scoped>
video {
  width: 100%;
}
</style>
